package com.gitee.clarence.interceptor.exception;

import com.gitee.clarence.common.enums.ResultEnum;

import lombok.Getter;

/**
 * @Author: luopeng
 * @Date: 2018年3月23日 22:14
 * @Description: 业务异常类
 */
@Getter
@SuppressWarnings("serial")
public class ServiceException extends RuntimeException{

    private Integer code;

    public ServiceException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }

    public ServiceException(Integer code, String message) {
        super(message);
        this.code = code;
    }
}
